/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author stumbledog
 */
@Entity
@Table(name = "fantasyteam")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Fantasyteam.findAll", query = "SELECT f FROM Fantasyteam f"),
    @NamedQuery(name = "Fantasyteam.findById", query = "SELECT f FROM Fantasyteam f WHERE f.id = :id"),
    @NamedQuery(name = "Fantasyteam.findByName", query = "SELECT f FROM Fantasyteam f WHERE f.name = :name"),
    @NamedQuery(name = "Fantasyteam.findByLogoUrl", query = "SELECT f FROM Fantasyteam f WHERE f.logoUrl = :logoUrl"),
    @NamedQuery(name = "Fantasyteam.findByCurrentWin", query = "SELECT f FROM Fantasyteam f WHERE f.currentWin = :currentWin"),
    @NamedQuery(name = "Fantasyteam.findByCurrentLose", query = "SELECT f FROM Fantasyteam f WHERE f.currentLose = :currentLose"),
    @NamedQuery(name = "Fantasyteam.findByCurrentWithdraw", query = "SELECT f FROM Fantasyteam f WHERE f.currentWithdraw = :currentWithdraw")})
public class Fantasyteam implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 45)
    @Column(name = "name")
    private String name;
    @Size(max = 120)
    @Column(name = "logoUrl")
    private String logoUrl;
    @Column(name = "currentWin")
    private Integer currentWin;
    @Column(name = "currentLose")
    private Integer currentLose;
    @Column(name = "currentWithdraw")
    private Integer currentWithdraw;
    @OneToMany(mappedBy = "homeTeamId")
    private Collection<Fantasymatch> fantasymatchCollection;
    @OneToMany(mappedBy = "awayTeamId")
    private Collection<Fantasymatch> fantasymatchCollection1;
    @OneToMany(mappedBy = "teamId")
    private Collection<Fantasydiscussion> fantasydiscussionCollection;
    @JoinColumn(name = "userId", referencedColumnName = "id")
    @ManyToOne
    private Fantasyuser userId;
    @JoinColumn(name = "leagueId", referencedColumnName = "id")
    @ManyToOne
    private Fantasyleague leagueId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "teamId")
    private Collection<Fantasydraftresult> fantasydraftresultCollection;
    @OneToMany(mappedBy = "teamId")
    private Collection<Fantasyrosterperweek> fantasyrosterperweekCollection;
    @OneToMany(mappedBy = "teamId")
    private Collection<Fantasygameresult> fantasygameresultCollection;

    public Fantasyteam() {
    }

    public Fantasyteam(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLogoUrl() {
        return logoUrl;
    }

    public void setLogoUrl(String logoUrl) {
        this.logoUrl = logoUrl;
    }

    public Integer getCurrentWin() {
        return currentWin;
    }

    public void setCurrentWin(Integer currentWin) {
        this.currentWin = currentWin;
    }

    public Integer getCurrentLose() {
        return currentLose;
    }

    public void setCurrentLose(Integer currentLose) {
        this.currentLose = currentLose;
    }

    public Integer getCurrentWithdraw() {
        return currentWithdraw;
    }

    public void setCurrentWithdraw(Integer currentWithdraw) {
        this.currentWithdraw = currentWithdraw;
    }

    @XmlTransient
    public Collection<Fantasymatch> getFantasymatchCollection() {
        return fantasymatchCollection;
    }

    public void setFantasymatchCollection(Collection<Fantasymatch> fantasymatchCollection) {
        this.fantasymatchCollection = fantasymatchCollection;
    }

    @XmlTransient
    public Collection<Fantasymatch> getFantasymatchCollection1() {
        return fantasymatchCollection1;
    }

    public void setFantasymatchCollection1(Collection<Fantasymatch> fantasymatchCollection1) {
        this.fantasymatchCollection1 = fantasymatchCollection1;
    }

    @XmlTransient
    public Collection<Fantasydiscussion> getFantasydiscussionCollection() {
        return fantasydiscussionCollection;
    }

    public void setFantasydiscussionCollection(Collection<Fantasydiscussion> fantasydiscussionCollection) {
        this.fantasydiscussionCollection = fantasydiscussionCollection;
    }

    public Fantasyuser getUserId() {
        return userId;
    }

    public void setUserId(Fantasyuser userId) {
        this.userId = userId;
    }

    public Fantasyleague getLeagueId() {
        return leagueId;
    }

    public void setLeagueId(Fantasyleague leagueId) {
        this.leagueId = leagueId;
    }

    @XmlTransient
    public Collection<Fantasydraftresult> getFantasydraftresultCollection() {
        return fantasydraftresultCollection;
    }

    public void setFantasydraftresultCollection(Collection<Fantasydraftresult> fantasydraftresultCollection) {
        this.fantasydraftresultCollection = fantasydraftresultCollection;
    }

    @XmlTransient
    public Collection<Fantasyrosterperweek> getFantasyrosterperweekCollection() {
        return fantasyrosterperweekCollection;
    }

    public void setFantasyrosterperweekCollection(Collection<Fantasyrosterperweek> fantasyrosterperweekCollection) {
        this.fantasyrosterperweekCollection = fantasyrosterperweekCollection;
    }

    @XmlTransient
    public Collection<Fantasygameresult> getFantasygameresultCollection() {
        return fantasygameresultCollection;
    }

    public void setFantasygameresultCollection(Collection<Fantasygameresult> fantasygameresultCollection) {
        this.fantasygameresultCollection = fantasygameresultCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fantasyteam)) {
            return false;
        }
        Fantasyteam other = (Fantasyteam) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Fantasyteam[ id=" + id + " ]";
    }
    
}
